<template>
  <div class="home">
    <div class="box">
      <p>网易云音乐</p>
      <button>下载App</button>
    </div>
    <div>
      <!-- 自己写的组件 -->
        <Dong></Dong>
        <!-- 第一部分导航 -->
        <!-- <Navbar> -->
          <!-- <div class="nav">
            <div class="l">
              <h2>网易云音乐</h2>
            </div>
            <div class="r">
              <span>下载App</span>
            </div>
          </div> -->
          
        <!-- </Navbar> -->
        <!-- 内容 -->
        <router-view></router-view>
        <!-- 底部 -->

      
    </div>
    <!-- <button @click="debounce_fn">测试防抖按钮</button> -->
    <Tabbars ind="name"></Tabbars>
  </div>
</template>

<script>
// @ is an alias to /src
 import Dong from "../wnagyi/Dong.vue"



import debounce from "../plugins/debounce";
import instance from "../request/api"
import Tabbars from '../components/Tabbars.vue';
//import Navbar from "../components/Navbar.vue"
// console.log(process.NODE_ENV)
export default {
  name: "Home",
  data() {
    return {
      debounce_fn: null,
    };
  },
  methods: {
    //业务函数
    fn() {
      console.log("防抖函数");
    },
  },
  created() {
    //对业务函数的防抖封装
    this.debounce_fn = debounce(this.fn, 3000);
    instance.get("/api").then(res=>{console.log(res.data)})
  },
  components: {
    Tabbars,
   
    // 自己项目写的
    Dong,
    //Navbar
    
  },
};
</script>
<style lang="less" scoped>
.home {
  * {
    padding: 0;
    margin: 0;
  }
  // background-color: @primary;
}

.box{
  width:100%;
  height: 80px;
  display: flex;
  align-items: center;
  background: rgb(192, 72, 60);
}
.box p{
  font-size: 20px;
  color: #fff;
}
.box button{
  margin-left: 150px;
  line-height: 35px;
  color: rgb(192, 72, 60);
  border: 1px solid #fff;
  background: #fff;
  width: 110px;
  height: 35px;
  border-radius: 1rem;
}
</style>
